package main

import "fmt"

func main() {
	var p1 Person
	fmt.Println(p1)
	p1.name = "王二狗"
	p1.age = 30
	p1.sex = "男"
	p1.address = "北京市"

	fmt.Printf("姓名：%s，年龄：%d，性别：%s，地址：%s \n",p1.name,p1.age,p1.sex,p1.address)


	p2:=Person{}
	fmt.Println(p2)
	p2.name = "Ruby"
	p2.age = 22
	p2.sex = "女"
	p2.address = "上海市"

	fmt.Printf("姓名：%s，年龄：%d，性别：%s，地址：%s \n",p2.name,p2.age,p2.sex,p2.address)

	p3:=Person{name:"如花",age:28,sex:"男",address:"杭州市"}
	fmt.Printf("姓名：%s，年龄：%d，性别：%s，地址：%s \n",p3.name,p3.age,p3.sex,p3.address)

	p4:=Person{"隔壁老王",33,"男","杭州市"}
	fmt.Printf("姓名：%s，年龄：%d，性别：%s，地址：%s \n",p4.name,p4.age,p4.sex,p4.address)
}

type Person struct {
	name string
	age int
	sex string
	address string
}
